package com.ee.bruscar;

import java.net.URL;

import org.antlr.stringtemplate.StringTemplate;
import org.antlr.stringtemplate.StringTemplateGroup;
import org.antlr.stringtemplate.language.DefaultTemplateLexer;

import com.ee.bruscar.generator.SimpleSetter;

public class TemplateRunner
{
	
	public static void main(String[] args)
	{
		URL thisUrl = TemplateRunner.class.getResource( ".");
		
		StringTemplateGroup group =  new StringTemplateGroup("myGroup", thisUrl.getPath() + "/templates", DefaultTemplateLexer.class);

		StringTemplate complexMethod = group.getInstanceOf("complexObjectMethod");
		complexMethod.setAttribute("complexObject", "Customer");
		
		SimpleSetter[] setters = new SimpleSetter[4];
		setters[0]  = new SimpleSetter( "firstName");
		setters[1]  = new SimpleSetter( "lastName");
		
		complexMethod.setAttribute("setters", setters);

		System.out.println(complexMethod.toString());


	}


}
